package com.lanbu.system.service.impl;

import com.lanbu.system.domain.mongo.MongoDatasets;
import com.lanbu.system.domain.mongo.MongoOpenApis;
import com.lanbu.system.domain.mongo.MongoOutlinks;

import com.lanbu.system.mapper.MongoOutlinksRepository;

import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MongoOutlinksService {
    private final MongoOutlinksRepository mongoOutlinksRepository;

    @Autowired
    public MongoOutlinksService(MongoOutlinksRepository mongoOutlinksRepository) {
        this.mongoOutlinksRepository = mongoOutlinksRepository;
    }


    public List<MongoOutlinks> findAll() {
        return mongoOutlinksRepository.findAll();
    }

    public MongoOutlinks findShareIdById(String id) {
        return mongoOutlinksRepository.findByShareId(id);
    }

    public    List<MongoOutlinks> findByTeamId(ObjectId teamId) {
        return mongoOutlinksRepository.findByTeamId(teamId);
    }


    public MongoOutlinks save(MongoOutlinks mongoOutlinksRepository1) {

        return mongoOutlinksRepository.save(mongoOutlinksRepository1);


    }

    public void deleteByTeamId(ObjectId teamId) {
        mongoOutlinksRepository.deleteByTeamId(teamId);
    }
}
